{
 "cells": [
  {
   "cell_type": "raw",
   "id": "5dac4296",
   "metadata": {},
   "source": [
    "列表的方法\t     Description\t                      使用方法\t                备注\n",
    "append\t    Append object to the end of the list.\t       list.append(object)\t        注意：增加在末尾\n",
    "count\t    用于统计某个元素在列表中出现的次数\t         list.count(obj)\t\n",
    "extend\t    在列表末尾一次性追加另一个序列中的多个值       list.extend(seq)\t\n",
    "index\t    从列表中找出某个值第一个匹配项的索引位置       list.index(x[, start[, end]])\t\n",
    "pop       移除列表中的一个元素\t                  list.pop([index=-1])\t\n",
    "remove\t    移除列表中某个值的第一个匹配项\tlist.remove(obj)\t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "f14f9916",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Don't panic!\n",
      "['D', 'o', 'n', \"'\", 't', ' ', 'p', 'a', 'n', 'i', 'c', '!']\n",
      "['o', 'n', ' ', 't', 'a', 'p']\n",
      "on tap\n"
     ]
    }
   ],
   "source": [
    "phrase = \"Don't panic!\"\n",
    "plist = list(phrase)\n",
    "print(phrase)\n",
    "print(plist)\n",
    "\n",
    "for i in range (4):\n",
    "    plist.pop()\n",
    "plist.pop(0)\n",
    "plist.remove(\"'\")\n",
    "plist.extend([plist.pop(),plist.pop()])\n",
    "plist.insert(2,plist.pop(3))\n",
    "\n",
    "new_phrase = ''.join(plist)\n",
    "print(plist)\n",
    "print(new_phrase)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "39613e2c",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
